package com.windersgroup.querynumber.conf;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import com.windersgroup.querynumber.intercepter.MyIntercepter;

/**
 * @author zkc
 * @date 2020/10/22
 */
@Configuration
public class MyWebAppConfig extends WebMvcConfigurationSupport  {

	@Autowired
	private MyIntercepter myIntercepter;

	@Override
	protected void addInterceptors(InterceptorRegistry registry) {
		// TODO Auto-generated method stub
		registry.addInterceptor(myIntercepter).addPathPatterns("/**")
			.excludePathPatterns("/machine/index/nologin","/machine/mapData","/static/**");
		super.addInterceptors(registry);
	}

	@Override
	protected void addResourceHandlers(ResourceHandlerRegistry registry) {
		// TODO Auto-generated method stub
		registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
	}



}